package com.hnust.controler.test;

import com.hnust.MainApp;
import com.hnust.controller.TeacherStuController;
import com.hnust.dao.TeacherClassDao;
import com.hnust.domain.Class;
import com.hnust.domain.Student;
import com.hnust.domain.record.StudentDetailSubjectData;
import com.hnust.domain.record.Visual1;
import com.hnust.domain.record.Visual2;
import com.hnust.util.Result;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = MainApp.class)
public class TeacherStu {
    @Autowired
    private TeacherClassDao teacherClassDao;
    @Autowired
    private TeacherStuController teacherStuController;
    @Test
    public  void testGetl(){
        List<Class> classes = teacherClassDao.queryClassByTeaId("1");

        for (Class cl:classes){


        }
    }


    @Test
    public  void testGe(){
        List<Student> students = teacherClassDao.queryStudentsByClassId("4");;

        for (Student c:students){


        }
    }

    @Test
    public  void testG(){
        List<Student> students = teacherClassDao.queryStudentsByClassId("4");;

        for (Student c:students){


        }
    }
    @Test
    public  void test(){
          List<StudentDetailSubjectData> studentDetailSubjectData = teacherClassDao.searchTeacherStu("ja","null","null","1");

           for(StudentDetailSubjectData s:studentDetailSubjectData){


           }

    }

    @Test
    public  void testm(){
        String maj = teacherClassDao.queryMajorByClassId("2");



    }
    @Test
    public  void tests(){
        Integer maj = teacherClassDao.searchSumCourse("计算机网络","54653");



    }
    @Test
    public  void testr(){
        Integer maj = teacherClassDao.searchRightCourse("操作","1805010129");



    }


    @Test
    public void testGetV1(){

        Result<List<Visual1>> result = teacherStuController.getVisual1("1","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEwMDg2IiwiaWQiOiIxMDA4OCIsImV4cCI6MTYwNDcxMjE3MSwiaWF0IjoxNjA0MTA3MzcxLCJqdGkiOiI0MTI5NDA5M2RiYjQ0ZjZlYTk2NDRkZDc0YTdjMzFlNSJ9.h1PWcZnquoFtzBvfAloQeVHuGYifuGpVBwtnFp6esPg");
       if(result==null){

       }
       else
        for(Visual1 major : result.data){

        }
    }

    @Test
    public void testGetV2(){
        Result<List<Visual2>> result = teacherStuController.getVisual2("1","eyJwYXNzd29yZCI6IjEwMDg2IiwiaWQiOiIxMDA4OCIsImV4cCI6MTYwNzQzMDI2MCwiaWF0IjoxNjA2ODI1NDYwLCJqdGkiOiIzYmM1OWMyZjI0MWU0ZTViODEwOTNlZDI1ZjNiNjFjNSJ9.Q1vRmLr_daBu9RwtJjqe34NQdHI5hBR3p67vQ-gLIa0");
        if(result==null){

        }
        for(Visual2 major : result.data){

        }
    }

    @Test
    public void testGetD(){
        //Result<List<StudentDetailSubjectData>> result = teacherStuController.getCourseInfo("1","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXNzd29yZCI6IjEiLCJpZCI6IjEwIiwiZXhwIjoxNjA4ODk1MTQ2LCJpYXQiOjE2MDgyOTAzNDYsImp0aSI6Ijc3ODVmZjA0ZmMzMzRlZWFiMmM0MjA3Mjk4MWEzNmY2In0.wKBzYNDbODFYJRglquJg19KatfoCv4gqFgJLnQfDGd4","null","null","null",1);
//        if(result==null){
//
//        }
//        for(StudentDetailSubjectData major : result.data){
//
//        }
    }

}
